/**
 * 
 */
package br.com.buscapecas.formatter;

import java.text.NumberFormat;


/**
 * @created 18/05/2010 - 09:31:07
 * @author Maikon Rafael da Rocha
 *
 */
public class DecimalFormatter extends Formatter {

    /**
     * 
     * @param decimalNumber
     * @param decimals
     * @return
     * @created 18/05/2010 - 09:37:05
     * @author Maikon Rafael da Rocha
     */
    public static String formatDecimal(Double decimalNumber, int decimals) {
        try {
            NumberFormat numberFormat = NumberFormat.getNumberInstance(ptBR);
            numberFormat.setMinimumFractionDigits(decimals);
            numberFormat.setMaximumFractionDigits(decimals);
            return numberFormat.format(decimalNumber);
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }
    
}
